<template>
  <el-button :type="type" :size="size" @click="go" :round="round" >
    <slot/>
  </el-button>
</template>

<script>
  import router from '@/router/index'

  export default {
    props: {
      'type': String,
      'round': {type: Boolean, default: false},
      'to': String,
      'back': { type: Boolean, default: false },
      'size': {type: String, default: 'medium'}
    },
    methods: {
      go() {
        if (this.back) {
          router.back()
        } else {
          router.push(this.to);
        }
      }
    }
  }
</script>
